package com.xce.account.controller;

import com.xce.account.service.AccountService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Tag(name = "接口")
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/debit")
    public String debit(@RequestParam("userId") String userId,@RequestParam("money") int money) {
        accountService.debit(userId, money);
        return "account debit success";
    }
}
